from django.db import models

from goods.models import GoodsModel
from user.models import UserModel


# Create your models here.

class CartModel(models.Model):
    user = models.ForeignKey(UserModel, on_delete=models.CASCADE, verbose_name='用户')
    goods = models.ForeignKey(GoodsModel, on_delete=models.CASCADE, verbose_name='商品')
    c_num = models.IntegerField(default=1, verbose_name='购买数量')
    select = models.BooleanField(default=True, verbose_name='是否选中')

    class Meta:
        db_table = 'sxcart'
